#ifndef _H_C_MPSC_SYNC_CONTEXT_H_
#define _H_C_MPSC_SYNC_CONTEXT_H_

#include "ISynchronizationContext.h"
#include "../collection.h"

namespace TB
{
	class CMPSCSyncContext : public ISynchronizationContext
	{
	public:
		virtual void Post(const std::function<void()>& cbAction) override;

		inline bool IsEmpty() const
		{
			return m_oActions.IsEmpty();
		}

		inline const std::function<void()>& Front() const
		{
			return m_oActions.Front();
		}

		inline void Pop()
		{
			m_oActions.Pop();
		}

	private:
		CMPSCQueue<std::function<void()>> m_oActions;
	};
}

#endif
